const path = require('path')

const resolve = dir => {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: './',
  outputDir: "client",
  lintOnSave: false,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
  },
  productionSourceMap: false,
  devServer: {
    port: '8080',
    host: 'localhost',
    proxy: {
      'api': {
        target: 'http://x15wywe2l9f7.xiaomiqiu.com',
        changeOrigin: true,
        secure: false,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      },
    },
  },
}
